package com.hyh.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.hyh.service.CoreService;
import com.hyh.util.ServiceUtil;

/**
 * Created by Administrator on 2019/1/28.
 */

public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.e("androidLog","222222");
        if(!ServiceUtil.isServiceRunning(context, CoreService.class.getName())){
            Intent intent1 = new Intent(context,CoreService.class);
            context.startService(intent1);
        }
    }
}
